async function loadNovel() {
  const url = `https://duyi-static.oss-cn-beijing.aliyuncs.com/files/novel.txt`
  const response = await fetch(url)
  // const text = await response.text()
  const reader = response.body.getReader()
  const decoder = new TextDecoder()
  let remainChunk = new Uint8Array(0)
  for(;;) {
    const { value, done } = await reader.read()
    if (done) {
      break
    }
    const lastIndex = value.lastIndexOf('\n')
    const chunk = value.slice(0, lastIndex)
    const readChunk = new Uint8Array(remainChunk.length + chunk.length)
    readChunk.set(remainChunk)
    readChunk.set(chunk, remainChunk.length)
    remainChunk = value.slice(lastIndex + 1)
    const text = decoder.decode(value)
    console.log(text)
  }
}

loadNovel()